#ifndef NOEUD_H
#define NOEUD_H

#include <QString>
#include <QList>
#include <iostream>
#include <QPoint>
#include <QImage>
#include <QComboBox>

class Noeud
{
private:


public:
    static unsigned int COMPTEUR_ID;
    unsigned int monID;// qu'est-ce qu'un noeud?
    unsigned int categorie;
    unsigned int type;
    unsigned int frequence;
    QString nom;
    QString description;
    QString precondition;
    QString tempsMax;
    QString tempsMin;
    QString tempsMoy;

    unsigned int relation;

    bool ariteOptionnel;
    bool ariteRepetable;
    // le pere
    Noeud * pere;
    // le frere en relation
    Noeud * frere;
    // la liste des fils
    QList<Noeud *> fils;

    // num ligne
    unsigned int noLigne;

    // position
    bool reposition;
    QPoint position;

    Noeud(unsigned int cat_type, QString n,
          QString description = QString("<Pas de description>"),
          unsigned int noLigne = 0);
    ~Noeud();

    /*** GETTERS ET SETTERS ***/

    unsigned int getCategorie();
    unsigned int getType();
    unsigned int getFrequence();
    QString getNom();
    QString getDescription();
    QString getPrecondition();
    QString getTempsMax();
    QString getTempsMin();
    QString getTempsMoy();
    Noeud * getPere();
    QList<Noeud *> getFils();
    unsigned int getNoLigne();
    QPoint getPosition();

    void setCategorie(unsigned int categorie);
    void setType(unsigned int type);
    void setFrequence(unsigned int frequence);
    void setNom(QString nom);
    void setDescription(QString description);
    void setPrecondition(QString precondition);
    void setTempsMax(QString tempsMax);
    void setTempsMin(QString tempsMin);
    void setTempsMoy(QString tempsMoy);
    void setPere(Noeud * pere);
    void addFils(Noeud * fils);
    void setPosition(QPoint p);

    void removeFils(Noeud * n);

    void setNoLigne(int noLigne);

    void inverserAvec(Noeud * aCopier);

    /*** STATIQUE ***/

    static QImage getImage(unsigned int categorie);
    static QImage getImageRelation(unsigned int relation);

    static Noeud * copie(Noeud * n);
    static Noeud * copieLocaleAvecFilsEtNouveauxID(Noeud * n);

    // les categories
    static const unsigned int ABSTRACTION = 0;
    static const unsigned int APPLICATION = 1;
    static const unsigned int INTERACTION = 2;
    static const unsigned int USER = 3;

    static const unsigned int NO_TYPE = 0;

    static const unsigned int APPLICATION_GENERATING_ALERTS = 1;
    static const unsigned int APPLICATION_GROUPING = 2;
    static const unsigned int APPLICATION_LOCATE = 3;
    static const unsigned int APPLICATION_OVERVIEW = 4;
    static const unsigned int APPLICATION_VISUALISE = 5;
    static const unsigned int APPLICATION_COMPARISON = 6;
    static const unsigned int APPLICATION_FEEDBACK = 7;

    static const unsigned int INTERACTION_RESPONDING_TO_ALERTS = 1;
    static const unsigned int INTERACTION_SELECTION_SINGLE_CHOICE = 2;
    static const unsigned int INTERACTION_SELECTION_MULTIPLE_CHOICE = 3;
    static const unsigned int INTERACTION_CONTROL = 4;
    static const unsigned int INTERACTION_EDIT = 5;
    static const unsigned int INTERACTION_MONITORING = 6;

    static const unsigned int USER_PLANNING = 1;
    static const unsigned int USER_PROBLEM_SOLVING = 2;
    static const unsigned int USER_COMPARING = 3;

    // images
    static QImage IMG_abstraction;
    static QImage IMG_application;
    static QImage IMG_interaction;
    static QImage IMG_user;
    static QImage IMG_orderIndependance;
    static QImage IMG_sequence;
    static QImage IMG_synchronisation;
    static QImage IMG_choix;

    // les relations
    static const unsigned int NO_RELATION = 0;
    static const unsigned int ORDER_INDEPENDANCE = 1;
    static const unsigned int SEQUENTIAL_ENABLING = 2;
    static const unsigned int SYNCHRONISATION = 3;
    static const unsigned int CHOICE = 4;


    void remplirTypeComboBox(QComboBox *typeComboBox, int categorie);

};

#endif // NOEUD_H
